package com.qyer.search.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * User: Z J Wu Date: 2016/01/20 Time: 14:43 Package: com.qyer.search.enums
 */
public enum SKUType1 {
  DIY(2667, "大自由行"),
  LOCAL(2410, "当地玩乐"),
  AIR_TICKETS(1016, "机票"),
  HOTEL(1017, "酒店"),
  AIR_HOTEL(1018, "自由行（机+酒）"),
  SHIP(1020, "邮轮"),
  CAR_RENTAL(1021, "租车"),
  INSURANCE(1049, "保险"),
  VISA(1785, "签证"),
  OTHER(-1, "未知一级类目");

  public static Map<Integer, String> SKU_TYPE1_MAP = new HashMap<>();

  static {
    for (SKUType1 type1 : EnumSet.allOf(SKUType1.class)) {
      SKU_TYPE1_MAP.put(type1.getId(), type1.getDesc());
    }
  }

  private int id;

  private String desc;

  SKUType1(int id, String desc) {
    this.id = id;
    this.desc = desc;
  }

  public int getId() {
    return id;
  }

  public String getDesc() {
    return desc;
  }

  public static String toDesc(int id) {
    switch (id) {
      case 2667:
        return DIY.getDesc();
      case 2410:
        return LOCAL.getDesc();
      case 1016:
        return AIR_TICKETS.getDesc();
      case 1017:
        return HOTEL.getDesc();
      case 1018:
        return AIR_HOTEL.getDesc();
      case 1020:
        return SHIP.getDesc();
      case 1021:
        return CAR_RENTAL.getDesc();
      case 1049:
        return INSURANCE.getDesc();
      case 1785:
        return VISA.getDesc();
      default:
        return OTHER.getDesc();
    }
  }
}
